1. Field of the Invention
The present invention generally relates to self-test techniques for storage devices and, more particularly, relates to a method for performing a variety of self-tests, storing and maintaining results and providing said results to host computer.
2. Description of Related Art
The vast majority of personal computer (or xe2x80x9cPCxe2x80x9d) systems available today come equipped with a peripheral storage device such as a hard disk drive, compact disk read-only-memory (CD-ROM), digital versatile disk (DVD) or floppy disk. These storage devices often comply with certain industry interface standards, such as ATA, integrated drive electronics (IDE), small computer systems interface (SCSI), Single Connector Attachment (SCA) or institute of electrical and electronic engineers (I.E.E.E.) 1394 bus.
Because the storage devices contain components that are subject to defects, testing is a large part of the manufacturing process for a storage device. Typically, after the storage device is manufactured it is powered on for certification testing and burn-in. A tester may also be connected to the storage device to receive test information from the storage device.
In the case of some storage devices, the certification tests are initiated based on a bit in software that is recognized when the storage device is powered up for the first time. The certification tests include an extensive set of proprietary read, write and servo tests and may vary by manufacturer. Upon completion of the tests, the storage device will provide a pass/fail indication, and possibly, and other test result information.
In the case of some storage device, a visible indication may be present on the storage device to indicate pass/fail. In the case of other storage device manufacturers, the test results are provided by the storage device to the tester over a proprietary serial cable. The same interface may be used during post failure analysis where the storage device receives test commands from the tester to determine the cause of a failure. In any event, the initial test results may be saved in a proprietary log on the storage device. The proprietary log is generally not available except at the factory.
If a failure is detected, the storage device may be repaired or rejected depending on the defect. For example, a single sector failure is typically marked as xe2x80x9cbadxe2x80x9d without rendering the drive otherwise perfectly satisfactory for sale. However, a motor instability problem that shows up during read/write tests may render the drive inoperable.
Testing is also a part of assembling a larger machine in which the storage device is a component, such as a computer or laser printer. Once the machine is assembled with the storage device, a battery of operations may be run on the machine to give the storage device a final checkout. If the storage device fails at this point, it is typically replaced and set aside for more tests, or sent back to the storage device manufacturer.
One such factory assembly test is Compaq""s Diagnostics for Windows (DFW) software. This software tests many components of a computer system, including storage devices. In addition to its factory use, DFW is available for end-users to test their computer. The software is particularly helpful for telephone support calls.
DFW operates from a host computer or surrogate computer to perform tests on the storage device, such as cable tests and read scans. The host computer provides a series of basic low level instructions to the storage device, which together form a specific test. Upon completion of the low-level instructions, the host computer may read the status and error registers to determine if the low-level instruction completed successfully. Since DFW must work with a wide variety of storage devices from different manufacturers, the low-level instructions must be common to all storage devices. Therefore, the type of tests that can be developed is somewhat limited. Furthermore, while DFW is easily adaptable to work with a wide variety of storage devices and tests, it is relatively slow at performing the tests since each test must be constructed from low level instructions and run from the surrogate computer. Thus, a standardized way of communicating test operations to a storage device, which would be capable of performing the test operations and logging the results itself, is desirable.
According to a preferred embodiment, a method of testing a storage device having an industry-standard interface, components and a non-volatile memory includes receiving a test command from a host computer and performing a test on one or more of the components. If a failure is detected, the storage device identifies the failed component and a corresponding segment of the test where the component failed, i.e., failure checkpoint, for storage in the non-volatile memory. Test results are provided to the host computer including, if a failure is detected, the failed component identification and the failure checkpoint.
The tests can be performed in an off-line or captive mode. In captive mode, the test is not subject to interruption by the host computer. A busy flag is set to indicate to the host computer that the storage device is busy. Power management is preferably disabled before performing the self-tests, and is re-enabled after performing the tests. The self-tests may include a number of component specific tests or general tests, such as a quick test and a comprehensive test.
If the test should be performed in off-line mode the method further includes monitoring for a new command from the host computer while performing the test, aborting the test if the new command indicates some form of stoppage or re-initialization, and aborting the test and starting a new test if the new command is a start self-test command. Otherwise, suspending the test, executing the new command after suspension and resuming the test after servicing the host computer.
The self-tests includes a variety of tests designed to test components of the storage device and overall health of the device, such as write tests, servo tests and read scan tests. The results of the tests are stored in the non-volatile memory and may include a test number, status indication, system configuration information, a pointer to the latest test results and a checksum.
In another embodiment, a storage device includes an industry-standard interface, a non-volatile memory and a controller coupled to the non-volatile memory that is operable to receive a test command from a host computer. In response to the test command, the controller is operable to perform one or more self-tests to test components of the storage device, detect failures of the components, and store results of the tests in a logging descriptor of the non-volatile memory. A certain number of descriptors are maintained in the non-volatile memory with the most recent descriptor being pointed to by an index pointer. When a failure is detected in the storage device, the results logged into the descriptor include a failed component identification and a failure checkpoint.
In another embodiment, a computer system includes a central processing unit coupled to a storage device. The storage device includes an industry-standard interface, a non-volatile memory and a controller coupled to the non-volatile memory that is operable to receive a test command from the central processing unit. In response to the test command, the controller is operable to perform one or more self-tests to test components of the storage device, detect failures of the components, and store results of the tests in the non-volatile memory. If a failure is detected, the results include a failed component indicator, a failure checkpoint and system configuration information.